package org.study.order.controller;

import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.study.order.service.OrderService;

import java.util.Map;

/**
 * 订单服务
 *
 * @author heshaohua
 * @version 1.0.0
 * @date 2024年07月30日 16:43:00
 */
@RestController
@RequestMapping("/core")
public class OrderController {

    private final OrderService orderService;


    public OrderController(OrderService orderService) {
        this.orderService = orderService;
    }

    /**
     * 下单api
     *
     * @return 是否成功
     */
    @RequestMapping("/create-order")
    public Object createOrder(@RequestBody Map<String, String> param){
        return this.orderService.createOrder(param.get("param"));
    }
}
